package com.example.demo.service;

import com.example.demo.bean.PurchaseOrder;
import com.example.demo.bean.Room;
import com.example.demo.dao.PurchaseOrderDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PurchaseOrderService {
    @Autowired
    PurchaseOrderDao dao;
    public int getCount(){
        return dao.getCount();
    }

    public int addPurchaseOrder(PurchaseOrder purchaseOrder){
        return dao.addPurchaseOrder(purchaseOrder);
    }

    public int deletePurchaseOrder(int order_id){
        return dao.deletePurchaseOrder(order_id);
    }

    public int updatePurchaseOrder(PurchaseOrder purchaseOrder){
        return dao.updatePurchaseOrder(purchaseOrder);
    }

    public List<PurchaseOrder> getAllPurchaseOrders(int page, int limit){
        return dao.getAllPurchaseOrders(page, limit);
    }

    public int getCountByStatus(String status){
        return dao.getCountByStatus(status);
    }


    public List<PurchaseOrder> findPurchaseOrdersById(String order_id) {
        return dao.findPurchaseOrdersById(order_id);
    }
}
